package com.suzhiliang.springbootlesson.staticResources;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Copyright (C), 2015-2018, XXX有限公司
 *
 * @ClassName: staticResourcesConfiguration
 * @Author: xmm
 * @Date: 2018/10/26 10:54
 * @Description: 配置拦截器的拦截路径，过滤掉静态文件的路径规则。
 * @Version 1.0
 */
@Configuration
public class staticResourcesConfiguration implements WebMvcConfigurer {

    //自定义静态资源文件地址
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/zlsu/resources/**").addResourceLocations("classpath:/static/");
    }
}
